#include<iostream>
#include<string>
#include"socket.hpp"
#include"protocol.hpp"
using namespace socket_ns;
using namespace protocol_ns;
void usage(std::string process)
{
    std::cout << "usage: " << process << "server_port" << std::endl;
}

int main(int argc,char* argv[])
{
    if(argc != 3)
    {
        usage(argv[0]);
        exit(USAGE_ERROR);
    }
    uint16_t server_port = std::stoi(argv[2]);
    std::string server_ip = argv[1];
    InetAddr server_addr(server_ip,server_port);
    factory _factory;
    std::unique_ptr<mysocket> client_ptr = std::make_unique<mysocket>();
    bool ret = client_ptr->build_client_socket(server_addr);
    std::string inbuffer;
    while(ret)
    {
        
    }
    return 0;
}